<div class='top' onmousedown='sortable()' >
  <div class='title'>
    <%= link_to_tool_by_setting @setting %>
  </div>
  <div class='tools'>
    <span id="portalet_<%= @setting.id %>_arrows" style='display:none;'>
      <%= link_to "←", "index", :class => :arrow %>
      <%= link_to "↑", "index", :class => :arrow %>
      <%= link_to "↓", "index", :class => :arrow %>
      <%= link_to "→", "index", :class => :arrow %>
    </span>
    <span class='h'>
      <%= link_to_remote "返回", 
            :update => "portalet_#{@setting.id}" ,
            :url => tools_site_healths_url(:setting_id => @setting.id),
            :method => :get,
            :html => {
              :class => :h 
            }            
        %>
    </span>
  </div>
</div>
<div id='tool_<%= @setting.id %>_content' class='content'>
  <% remote_form_for "setting_#{@setting.id}",
       @setting,
       :update => "portalet_#{@setting.id}",
       :url => tools_site_health_url(@setting),
       :method => :put,
       :html => {
         :id => "setting_form_#{@setting.id}"
       } do |f| %> 
  <dl>
    <dt>名称:</dt>
    <dd>
      <%= f.text_field :name %>
    </dd>
  </dl>
  <dl>
    <dt>URL<span>(需以http://或https://协议开头)</span>:</dt>
    <dd>
      <%= f.text_field :site_url %>
    </dd>
  </dl>
  <dl>
    <dt>匹配内容<span>(请填写URL页面包含的内容)</span>:</dt>
    <dd>
      <%= f.text_field :content_keyword %>
    </dd>
  </dl>
  <dl>
    <dt>短信报告:</dt>
    <dd>
      <%= f.check_box :allow_sms,{ :class => 's no'},'yes','no' %><%= f.label :allow_sms, '开通' %>
      <%= link_to_add_fetion_if_setting_user_no_mobile @setting %>
    </dd>
  </dl>
  <dl>
    <dt>email报告:</dt>
    <dd>
      <%= f.check_box :allow_email,{:class => 's no'},'yes','no' %><%= f.label :allow_email, '开通' %>
    </dd>
  </dl>
  <dl>
    <dt>每日整点报告:</dt>
    <dd>
      <%= f.select :report_hour,[
            ['0点',0],
            ['1点',1],
            ['2点',2],
            ['3点',3],
            ['4点',4],
            ['5点',5],
            ['6点',6],
            ['7点',7],
            ['8点',8],
            ['9点',9],
            ['10点',10],
            ['11点',11],
            ['12点',12],
            ['13点',13],
            ['14点',14],
            ['15点',15],
            ['16点',16],
            ['17点',17],
            ['18点',18],
            ['19点',19],
            ['20点',20],
            ['21点',21],
            ['22点',22],
            ['23点',23]
          ]  
       %>
    </dd>
  </dl>    
  <% end %>
  <dl class='bottom'>
    <dd>
      <%= link_to_remote "把脉",
                :url => test_site_heart_beat_tools_site_healths_url,
                :method => :post,
                :with => "'&url=' + $F('setting_#{@setting.id}_site_url') + '&content=' + $F('setting_#{@setting.id}_content_keyword')",
                :loading => "$('test_site_#{@setting.id}').innerHTML='把脉中...'",
                :failure => "alert(request.responseText);",
                :success => "alert(request.responseText);",
                :complete => "$('test_site_#{@setting.id}').innerHTML='把脉'",
                :html => {
                  :class => :other,
                  :title => '看看网站是否可访问',
                  :id => "test_site_#{@setting.id}"
                }
       %>
      <%= link_to_function "保存", "$('setting_form_#{@setting.id}').onsubmit()", :class => :submit %>
      <%= link_to_remote "重置",
            :update => "portalet_#{@setting.id}",
            :url => edit_tools_site_health_url(@setting),
            :method => :get,
            :html => {
              :class => :reset
            } %>
      <%= link_to_remote  "返回", 
            :update => "portalet_#{@setting.id}",
            :url => tools_site_healths_url(:setting_id => @setting.id),
            :method => :get,
            :html => {
              :class => :return
            } %>
    </dd>
  </dl>
</div>